﻿@model Resto.CostControl.Core.Models.SysSettings.UserInfo
@{
    ViewBag.Title = "用户管理";
    Layout = "~/Views/Shared/_LayoutForm.cshtml"; 
}
<style type="text/css">
    .pageFormContent p
    {
        width: auto;
    }
</style>
@Html.Css("dailog")
@Html.Js("dailog")
@using (Html.AjaxBeginForm("SaveUserInfo"))
{ 
    <div class="pageFormContent">
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.OrgId)
        @Html.HiddenFor(model => model.OrgCode)
        @Html.DWZTextBoxFor(model => model.OrgName, @Url.GridLink("setGroup", "移动", "MoveOrg()", new { style = "display: block; float: left; padding-top:5px;" }), new { style = "width:100px" }).Disable(true)
        @Html.DWZTextBoxFor(model => model.UserCode, new { style = "width:340px" }).Remote(@Url.Action("ValidUserCode", new { Id = Model.Id })).Required()
        @Html.DWZTextBoxFor(model => model.UserName, new { style = "width:340px" }).Required()
        @if (string.IsNullOrEmpty(Model.Password))
        {
            @Html.DWZPasswordFor(model => model.Password, new { style = "width:340px" }).Required()
        }
        @Html.DWZTextBoxFor(model => model.SeqNo, new { style = "width:340px" }).Required()
        @Html.DWZRadioListFor(model => model.AccountState, "AccountState")
    </div>
}
@Html.FormBar()
<script type="text/javascript">
    function MoveOrg(e) {
        OpenModalDialog('@Url.Action("setOrg")?mode=2', { width: 240, height: 300, onclose: function (group) {
            if (group && group.length > 0) {
                $("#OrgCode").val(group[0].value);
                $("#OrgName").val(group[0].text);
                $("#OrgId").val(group[0].id);
            }
        }
        });
    }
</script>
